package com.zh.risk.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/**
 * code is far away from bug with the animal protecting
 * ┏┓　　　┏┓
 * ┏┛┻━━━┛┻┓
 * ┃　　　　　　　┃
 * ┃　　　━　　　┃
 * ┃　┳┛　┗┳　┃
 * ┃　　　　　　　┃
 * ┃　　　┻　　　┃
 * ┃　　　　　　　┃
 * ┗━┓　　　┏━┛
 * 　　┃　　　┃神兽保佑
 * 　　┃　　　┃代码无BUG！
 * 　　┃　　　┗━━━┓
 * 　　┃　　　　　　　┣┓
 * 　　┃　　　　　　　┏┛
 * 　　┗┓┓┏━┳┓┏┛
 * 　　　┃┫┫　┃┫┫
 * 　　　┗┻┛　┗┻┛
 *
 * @Description: 定时任务配置
 * @Author: Liard
 * @Create in: 2020/7/14 15:45
 * @Version: 1.0.1
 */
@ApiModel(value = "定时任务配置实体信息")
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("elec_risk_task_config")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class RiskCronConf extends Model<RiskCronConf> {

    private static final long serialVersionUID = -8490498304682190443L;

    @ApiModelProperty(value = "主键", name = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "设置定时任务启动表达式", name = "cron")
    private String cron;

    @ApiModelProperty(value = "最后操作人姓名", name = "operator")
    private String operator;

    @ApiModelProperty(value = "是否开启(0.关闭,1.开启)", name = "scheduledEnable")
    private Boolean scheduledEnable;

    @ApiModelProperty(value = "定时任务名称", name = "name")
    private String name;

    @ApiModelProperty(value = "描述内容", name = "description")
    private String description;

    @ApiModelProperty(value = "重试机制次数，最小值1,最大值9次", name = "retryCount")
    private Integer retryCount;

    @ApiModelProperty(value = "重试机制是否开启(0.关闭,1.开启)", name = "retryEnable")
    private Boolean retryEnable;

    @ApiModelProperty(value = "创建时间", name = "createDate")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh_CN")
    private Date createDate;

    @ApiModelProperty(value = "需要执行的任务列表", name = "listTpl")
    @TableField(exist = false)
    private List<RiskMerchTrans> listTpl;

    @ApiModelProperty(value = "需要执行的任务id集合", name = "createDate")
    @TableField(exist = false)
    private String riskTransComponentId;

}
